package net.xyuu.entity;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created by XYUU on 2016/11/27.
 */
@Entity
@Table(name="category")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
public class Category implements Serializable {

    @Id
    @Column
    private long id;
    @Column
    private String name;
    @Column
    private long left;
    @Column
    private long right;
    @ManyToOne(fetch = FetchType.LAZY,cascade = CascadeType.ALL)
    @JoinColumn(name = "site")
    private Site site;

    public Site getSite() {
        return site;
    }

    public Category setSite(Site site) {
        this.site = site;
        return this;
    }

    public long getId() {
        return id;
    }

    public Category setId(long id) {
        this.id = id;
        return this;
    }

    public String getName() {
        return name;
    }

    public Category setName(String name) {
        this.name = name;
        return this;
    }

    public long getLeft() {
        return left;
    }

    public Category setLeft(long left) {
        this.left = left;
        return this;
    }

    public long getRight() {
        return right;
    }

    public Category setRight(long right) {
        this.right = right;
        return this;
    }
}
